const testColor = {
	created() {
		console.log('testColor', 'created');
	},
    beforeMount(el, binding, vnode, prevVnode) {
    	console.log('testColor', 'beforeMount');
    },
    mounted(el, binding, vnode, prevVnode) {
    	console.log('testColor', 'mounted');
    	//设置样式
    	el.style.color = binding.value || '#8841AB';
    	//获取上下文
    	const vm = binding.instance;//
    	console.log('vm', vm.color1);//red
    	//绑定事件
    	el.addEventListener('click', function() {
    		console.log('testColor', 'click');
    	});
    	console.log('vnode', vnode);
    },
    beforeUpdate(el, binding, vnode, prevVnode) {
    	console.log('testColor', 'beforeUpdate');
    	el.style.color = binding.value;
    },
    updated() {
    	console.log('testColor', 'updated');
    },
    beforeUnmount() {
    	console.log('testColor', 'beforeUnmount');
    },
    unmounted() {
    	console.log('testColor', 'unmounted');
    },
};

export default testColor;